# Contributor: Lucas Ramage <ramage.lucas@protonmail.com>
# Maintainer: Lucas Ramage <ramage.lucas@protonmail.com>
pkgname=img
pkgver=0.5.10
pkgrel=0
pkgdesc="Standalone, daemon-less, unprivileged Dockerfile and OCI compatible container image builder"
url="https://github.com/genuinetools/img"
arch="x86_64"
license="MIT"
options="!check chmod-clean"
depends="go runc shadow-uidmap"
makedepends="bash libseccomp-dev"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/genuinetools/img/archive/v$pkgver.tar.gz"
builddir="$srcdir/src/github.com/genuinetools/img"

build() {
	cd "$srcdir"
	export GOPATH="$PWD"
	mkdir -p "$(dirname "$builddir")"
	ln -s "$PWD/$pkgname-$pkgver" "$builddir"
	cd "$builddir"
	go get -u github.com/jteeuwen/go-bindata/...
	make BUILDTAGS="seccomp noembed"
}

package() {
	install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
	install -Dm644 README.md "$pkgdir"/usr/share/doc/$pkgname/README.md
}

sha512sums="8e4df8a781cc040a858254b537d7c4b53bb34a12e89eed724402c3c9f9c732dd2692d3c773a228b1f3525cc89d94b1ce9814fba7ac3123fb941471eedb8069a7  img-0.5.10.tar.gz"
